package com.quartz1.service;

import com.quartz1.model.JobAndTrigger;
import com.quartz1.model.JobInfo;
import org.quartz.Job;

import java.util.List;

public interface ScheduleService {
    /**
     * 添加任务
     */
    String scheduleJob(Class<? extends Job> jobBeanClass, String cron, String data);
//    Boolean scheduleJob(String jobName, String jobGroup, String job, String cron);
    Boolean scheduleJob(JobInfo jobInfo);

    /**
     * 更新任务
     */
    Boolean reScheduleJob(String jobName, String jobGroup, String cronExpression) throws Exception;

    /**
     * 暂停任务
     */
    Boolean pausejob(String jobName, String jobGroup) throws Exception;

    /**
     * 恢复任务
     */
    Boolean resumejob(String jobName, String jobGroup) throws Exception;

    /**
     * 取消任务
     */
    Boolean cancelScheduleJob(String jobName);

    /**
     * 查询任务
     */
    List<JobAndTrigger> getJobAndTriggerDetails(int pageNum, int pageSize);
}
